04. Two-Asset Portfolio Optimization
Derivation of Optimal Weights on a Two-Asset Portfolio
So how do we set up the portfolio optimization problem? In general, we know that we want high returns and low variance of returns, and that the weights on each asset in our portfolio should sum to 1.
Let's again consider a portfolio a portfolio with 2 assets in it, Stock A and Stock B. We want to solve for the weight on each asset, x_A and x_B .
Our objective function for this problem is the expression for the portfolio variance:
This is what we will seek to minimize .
We've seen these quantities before, but let's just briefly recall what all these symbols mean:
\sigma_P^2
is the portfolio variance.
\sigma_A^2
is the variance of the return of Stock A.
\sigma_B^2
is the variance of the return of Stock B.
\rho_{r_Ar_B}
is the correlation between the returns of stocks A and B.
Our only constraint is:
It turns out that this is a problem we can solve analytically. If we substitute (2) into (1) , we will get a function of a single variable:
Now, let's take a breather and look at a plot of \sigma_P^2 as a function of x_A , to get a sense of what the function looks like. Let's assume some values for the variables \sigma_A , \sigma_B , and \rho_{r_Ar_B} .
If, \sigma_A = 0.1 , \sigma_B = 0.05 , and \rho_{r_Ar_B} = 0.25 , then the plot looks like this:
Cool, it's a parabola. So now we see that we are looking for the bottom of that parabola again.
So, since this is a problem in only one variable, x_A , let's take the derivative with respect to x_A , and solve for the value of x_A that makes the resulting expression equal 0:
From the constraint condition, (2) , we have:
Now we know the portfolio weights. You can see that they are only dependent on the standard deviations of Stock A and B, and their covariance. If we wanted to know the expected portfolio mean, we only have to remember that it is the weighted sum of the individual portfolio means:
To be sure our solution is a minimum , we should check the second-order condition. We will leave this as an exercise to you.